<?php

namespace app\validate;

use app\base\BaseValidate;

/**
 * 验证器-ActivityGoodsValidate
 * Class ActivityGoodsValidate
 * @package app\validate
 */
class ActivityGoodsValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'require|number',
        'activity_id|活动id' => 'require',
        'sell_price|团购价格' => 'gt:0',
        'condition|团购条件' => 'egt:2',
        'condition_time|团购有效时间' => 'require',
        'goods_storage|入库数量' => 'egt:0',
        'status|状态' => 'require|in:1,2',
    ];
    //验证场景-更新
    public function sceneChange()
    {
        return $this->only(['id', 'aid', 'change', 'storage']);
    }
}
